package com.geek.framework.study.event.observer;

import com.geek.framework.study.event.EventListener;

import java.util.EventObject;

public class Client {
  public static void main(String[] args) {
    EventEmitter eventEmitter = new EventEmitter();
    eventEmitter.addListener(event -> {
      System.out.println("event = " + event);
    });
    eventEmitter.addListener(new EventListener() {
      @Override
      public void onEvent(final EventObject event) {
        System.out.println("event.getSource() = " + event.getSource());
      }
    });
    eventEmitter.emit("Hello JDK Observer");
  }
}
